Skip to main content

Sync Trades

📝 Sync Trade Request

FieldDetails
API NameSyncTrades
URL Format<protocol>://<domain name:port>/<VirtualDir>/<URL>
Example URLhttps://localhost:8080/OTPA/V1/SyncTrades
DescriptionThis request retrieves all trades available in the system. Upon receiving this request, the system sends trade information messages. The request must include jToken received from the Authentication API response.

🗺️ Sync Trade Request Parameters

ParameterData TypeDescription
jMessageTypevarchar(15)Must be sent as SYNC_ORDER_REQ (Confirm: Often trade sync uses SYNC_TRADE_REQ, but using your given text exactly.)
jManagerIDvarchar(50)Manager Identification Number
jCustomerIdvarchar(50)Customer ID assigned to the user
jExchangeintExchange identifier
jTokenvarchar(512)Authentication token received from the Authentication API
jEntrySequenceNumberint64Last received sequence number (default 0 if not provided)
jRequestIDvarchar(255)Echo‑back field

Example Sync Trade Request

{
"jMessageType": "SYNC_ORDER_REQ",
"jManagerID": "<MANAGER_ID>",
"jCustomerId": "<CUSTOMER_ID>",
"jExchange": 1,
"jToken": "<Token received in Authentication Response>",
"jEntrySequenceNumber": 0,
"jRequestID": "<Echo back field>"
}

💻 Sync Trade Response

The response contains the following parameters:

ParameterData TypeDescription
jManagerIdvarchar(50)User ID assigned to the user
jCustomerIdvarchar(50)Customer ID assigned to the user
jLastSyncedPacketintIndicates if this is the last packet: 1 = Last packet
jNoOfRecordsintNumber of trade records included
jTradeMessageTrade Detail Structure (array)Array of trade detail records, with size equal to jNoOfRecords
jRequestIDvarchar(255)Echo‑back field
jResponseIDvarchar(255)System‑generated alphanumeric ID

🧩 Trade Detail Structure

Each entry inside jTradeMessage contains the following fields:

Parameter (Key)Data TypeDescription
Trade NumberintTrade number
Order NumberintUnique order number
Cli Order NumberintGateway/Client order number (system-generated)
Exchangevarchar(10)Exchange
Scrip TokenintScrip token
SymbolfloatExchange-provided security scrip name
Seriesvarchar(3)Exchange-provided security series
InstrumentNamevarchar(20)Instrument name. Valid values:
• Equity = blank
• Future Index = FUTIDX
• Interest Rate Future = FUTINT
• Future Stock = FUTSTK
• Option Index = OPTIDX
• Option Stock = OPTSTK
• MCX/NCDEX Futures = FUTCOM
• MCX Spot = COM
• NCDEX Spot = COMDTY
• NSE Currency Future = FUTCUR, FUTIRD, FUTIRT, OPTCUR
• NSE Currency Spot = INDEX, UNDCUR, UNDIRD, UNDIRT
Expiry Datevarchar(10)Expiry date (ddMMMyyyy, e.g., 24JUN2004). Applicable for F&O only; otherwise blank.
Strike PricefloatExchange-provided strike price (in rupees). Applicable for options only; otherwise -1.
Option Typevarchar(2)Option type. Applicable for options only; otherwise blank.
Buy SellintBuy/Sell flag:
1 → Buy
2 → Sell
TradedQtyintTraded quantity
TradedPricefloatTraded price (in rupees)
Order Typevarchar(10)Type of the order
Pro/CliintParticipant flag:
2 → PRO
1 → CLI
User IDvarchar(10)Client code (blank for PRO users)
DealerCodevarchar(5)Unique user identification code
Part Codevarchar(12)Participant code; otherwise blank
TradeTimevarchar(10)Trade timestamp (e.g., 15Jun2018 15.25.15)
Modify Timevarchar(10)Modification timestamp (e.g., 15Jun2018 15.25.15)
Aliasvarchar(5)Alias ID; otherwise blank
Productvarchar(5)Product type
Initiated Byvarchar(25)Application that initiated the trade (e.g., ADMIN, NET)
Modified Byvarchar(25)Application that modified the trade
Initiated By User Idvarchar(10)User ID that initiated the trade
Modified By User Idvarchar(10)User ID that modified the trade
Leg IndicatorintSpread leg indicator
LocationIDvarchar(5)Location ID (PIN + NSECTCLBRANCH ID + NSECTCLID + ALGO FLAG + VENDOR CODE). Can be blank.
User Remarksvarchar(10)User-provided remarks
Miscvarchar(50)Miscellaneous values:
SPO-LMT
SPO-MKT
PO-MKT
PO-LMT
SpreadFlagintSpread flag:
1 → Spread
0 → Normal
Spread PricefloatSpread price (in rupees)
SequenceNoint64Unique sequence number
Order PricefloatOrder price (fresh or modified) in rupees
UniqueCodevarchar(12)Alphanumeric value with special characters